package com.member.common.enums;

import lombok.Getter;

import java.util.Objects;

/*
*
* 是否管理员(0:非管理员,1:管理员)
* */
@Getter
public enum IsAdminEnum {
    NOT_ADMINISTRATOR( 0, "非管理员"),
    ADMINISTRATOR( 1, "管理员"),
    ;

    private final Integer key;
    private final String desc;

    IsAdminEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static IsAdminEnum getByKey(Integer _key){
        for (IsAdminEnum item : IsAdminEnum.values()){
            if(Objects.equals(item.getKey(), _key)){
                return item;
            }
        }
        return null;
    }

}
